<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>${_title}</title>

    <!-- Bootstrap core CSS -->

    <link href="${_css}/bootstrap.min.css" rel="stylesheet">

    <link href="${_font}/css/font-awesome.min.css" rel="stylesheet">
    <link href="${_css}/animate.min.css" rel="stylesheet">

    <!-- Custom styling plus plugins -->
    <link href="${_css}/custom.css" rel="stylesheet">
    <link href="${_css}/icheck/flat/green.css" rel="stylesheet">
    <link href="${_css}/datatables/tools/css/dataTables.tableTools.css" rel="stylesheet">
	<link rel="stylesheet" href="${_css}/base.css">
    <script src="${_js}/jquery.min.js"></script>
	<script src="${_js}/resize.js"></script>
	<script type="text/javascript" src="${_front_js}/jquery.page.js"></script>
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
          <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->
	<style>
		td a{
			cursor:pointer
		}
	</style>
</head>


<body style="background: #F7F7F7;">
<div class="">
    <div class="row">
        <div class="col-md-12 col-sm-12 col-xs-12">
            <div class="x_panel">
	            <div class="x_title">
					<h2>初审借款</h2>
					<div class="clearfix"></div>
				</div>
                <div class="pull-right">
                	<button id="query" type="button" class="btn btn-info">查询</button>
                </div>
                <form class="form-horizontal form-label-left input_mask">
                    <div class="col-md-2 col-sm-2 col-xs-6 form-group has-feedback">
                        <input type="text" class="form-control has-feedback-left" id="username" value="<#if username?exists>${username}</#if>"
                        placeholder="输入用户名">
                        <span class="fa fa-user form-control-feedback left" aria-hidden="true"></span>
                    </div>
                    <div class="col-md-2 col-sm-2 col-xs-5 form-group has-feedback">
                        <select class="form-control" id="deadline" >
                        	<option value="-1" <#if deadline?exists & deadline==-1>selected="selected"</#if>>--请选择借款期限(月)--</option>
							<option value="1" <#if deadline?exists & deadline==1>selected="selected"</#if>>1个月</option>
							<option value="2" <#if deadline?exists & deadline==2>selected="selected"</#if>>2个月</option>
							<option value="3" <#if deadline?exists & deadline==3>selected="selected"</#if>>3个月</option>
							<option value="4" <#if deadline?exists & deadline==4>selected="selected"</#if>>4个月</option>
							<option value="5" <#if deadline?exists & deadline==5>selected="selected"</#if>>5个月</option>
							<option value="6" <#if deadline?exists & deadline==6>selected="selected"</#if>>6个月</option>
							<option value="7" <#if deadline?exists & deadline==7>selected="selected"</#if>>7个月</option>
							<option value="8" <#if deadline?exists & deadline==8>selected="selected"</#if>>8个月</option>
							<option value="9" <#if deadline?exists & deadline==9>selected="selected"</#if>>9个月</option>
							<option value="10" <#if deadline?exists & deadline==10>selected="selected"</#if>>10个月</option>
							<option value="11" <#if deadline?exists & deadline==11>selected="selected"</#if>>11个月</option>
							<option value="12" <#if deadline?exists & deadline==12>selected="selected"</#if>>12个月</option>
						</select>
                    </div>
                    <div class="col-md-2 col-sm-2 col-xs-5 form-group has-feedback">
                        <select class="form-control" id="dayline">
                        	<option value="-1"<#if deadline?exists & deadline==-1>selected="selected"</#if>>--请选择借款期限(天)--</option>
							<option value="1"<#if dayline?exists & dayline==1>selected="selected"</#if>>1天</option>
							<option value="2"<#if dayline?exists & dayline==2>selected="selected"</#if>>2天</option>
							<option value="3"<#if dayline?exists & dayline==3>selected="selected"</#if>>3天</option>
							<option value="4"<#if dayline?exists & dayline==4>selected="selected"</#if>>4天</option>
							<option value="5"<#if dayline?exists & dayline==5>selected="selected"</#if>>5天</option>
							<option value="6"<#if dayline?exists & dayline==6>selected="selected"</#if>>6天</option>
							<option value="7"<#if dayline?exists & dayline==7>selected="selected"</#if>>7天</option>
							<option value="8"<#if dayline?exists & dayline==8>selected="selected"</#if>>8天</option>
							<option value="9"<#if dayline?exists & dayline==9>selected="selected"</#if>>9天</option>
							<option value="10"<#if dayline?exists & dayline==10>selected="selected"</#if>>10天</option>
							<option value="11"<#if dayline?exists & dayline==11>selected="selected"</#if>>11天</option>
							<option value="12"<#if dayline?exists & dayline==12>selected="selected"</#if>>12天</option>
							<option value="13"<#if dayline?exists & dayline==13>selected="selected"</#if>>13天</option>
							<option value="14"<#if dayline?exists & dayline==14>selected="selected"</#if>>14天</option>
							<option value="15"<#if dayline?exists & dayline==15>selected="selected"</#if>>15天</option>
							<option value="16"<#if dayline?exists & dayline==16>selected="selected"</#if>>16天</option>
							<option value="17"<#if dayline?exists & dayline==17>selected="selected"</#if>>17天</option>
							<option value="18"<#if dayline?exists & dayline==18>selected="selected"</#if>>18天</option>
							<option value="19"<#if dayline?exists & dayline==19>selected="selected"</#if>>19天</option>
							<option value="20"<#if dayline?exists & dayline==20>selected="selected"</#if>>20天</option>
							<option value="21"<#if dayline?exists & dayline==21>selected="selected"</#if>>21天</option>
							<option value="22"<#if dayline?exists & dayline==22>selected="selected"</#if>>22天</option>
							<option value="23"<#if dayline?exists & dayline==23>selected="selected"</#if>>23天</option>
							<option value="24"<#if dayline?exists & dayline==24>selected="selected"</#if>>24天</option>
							<option value="25"<#if dayline?exists & dayline==25>selected="selected"</#if>>25天</option>
							<option value="26"<#if dayline?exists & dayline==26>selected="selected"</#if>>26天</option>
							<option value="27"<#if dayline?exists & dayline==27>selected="selected"</#if>>27天</option>
							<option value="28"<#if dayline?exists & dayline==28>selected="selected"</#if>>28天</option>
							<option value="29"<#if dayline?exists & dayline==29>selected="selected"</#if>>29天</option>
						</select>
                    </div>
                    <div class="col-md-2 col-sm-2 col-xs-5 form-group has-feedback">
                        <select class="form-control" id="status" >
                        	<option value="-1" <#if status?exists & status==-1>selected="selected"</#if>>--请选择申请状态--</option>
							<option value="1" <#if status?exists & status==1>selected="selected"</#if>>初审中</option>
							<option value="2" <#if status?exists & status==2>selected="selected"</#if>>已审核</option>
						</select>
                    </div>
                 </form>
                <div class="clearfix"></div>
            </div>
            <div class="scroll">
                <div class="x_content">
                    <table id="example" data-action="/admin/borrow/apply/list?1=1" class="table table-striped responsive-utilities jambo_table">
                        <thead>
                            <tr class="headings">
                                <th>
                                    <input type="checkbox" class="tableflat">
                                </th>
                                <th>序号 </th>
                                <th>申请用户名</th>
                                <th>真实姓名</th>
                                <th>手机号</th>
                                <th>借款用途 </th>
                                <th>借款金额(￥)</th>
                                <th>借款期限 </th>
                                <th>借款类型 </th>
                                <th>申请状态 </th>
                                <th>申请时间 </th>
                             	<th>操作</th>
                            </tr>
                        </thead>

                        <tbody>
			                <#if (pageInfo.pageList?size > 0)>
								<#list pageInfo.pageList as model>
									<tr class="even pointer">
		                                <td class="a-center ">
		                                    <input type="checkbox" class="tableflat">
		                                </td>
		                                <td>
		                                	${model_index+1}
		                                </td>
		                                <td>
		                                	<#if model.userName?exists>
		                                		${model.userName}
		                                	</#if>
		                                </td>
		                                <td>
		                                	<#if model.realName?exists>
		                                		${model.realName}
		                                	</#if>
		                                </td>
		                                <td>
		                                	<#if model.phone?exists>
		                                		${model.phone}
		                                	</#if>
		                                </td>
		                                <td style="width:540px;">
		                                	<#if model.use?exists>
		                               			${model.use}
		                               		</#if>
		                                </td>		                                
		                                <td>
		                                	<#if model.amount?exists>
		                                		<#if (model.amount != 0 )>
			                                		${model.amount?string('#.00')}
			                                	<#else>
			                                	 	${model.amount?string('0.00')}
			                                	</#if>
		                                	</#if>
		                                </td>		                                		                                
		                                <td>
		                                	<#if model.dateUtil?exists && model.dateUtil == "MONTH">
		                                		${model.date}个月
		                                	<#elseif model.dateUtil?exists && model.dateUtil == "DAY">
		                                		${model.date}天
		                                	</#if>
		                                </td>
		                                <td>
			                               <#if model.applyType?exists>
		                                		<#if productList?exists>
		                                			<#list productList as product>
		                                				<#if model.applyType == product.id?string>${product.name}</#if>
		                                			</#list>
			                                	</#if>
		                                	</#if>
		                                </td>								
		                                <td>
		                                	<#if model.status?exists>
			                                	<#if model.status==1>
			                                		初审中
			                                	<#elseif model.status==2>
			                                		已审核
			                                	</#if>
			                                </#if>		   
		                                </td>
		                                <td>
		                                	<#if model.createTime?exists>
		                                		${(model.createTime?string("yyyy-MM-dd HH:mm:ss"))}	   
		                                	</#if>                             	
		                                </td>
		                                 <td>
		                                 	<a class="btn-check" data-id="${model.id}" href="/admin/borrow/apply/detail?id=${model.id}">查看</a>
		                                </td>
		                             </tr>   
		                        </#list>
		                    <#else>
								<tr class="even pointer">
									<td colspan="15">无记录</td>
								</tr>
							</#if>
                        </tbody>
                    </table>
                    <#if (pageInfo.pageList?size > 0)>
	                	<#include "../base/Page.ftl">
	                </#if>
                </div>
            </div>
        </div>
        <br />
        <br />
        <br />
    </div>
</div>

<script src="${_js}/bootstrap.min.js"></script>

<!-- bootstrap progress js -->
<script src="${_js}/progressbar/bootstrap-progressbar.min.js" type="text/javascript"></script>
<script src="${_js}/nicescroll/jquery.nicescroll.min.js" type="text/javascript"></script>
<!-- icheck -->
<script src="${_js}/icheck/icheck.min.js" type="text/javascript"></script>

<script src="${_js}/custom.js" type="text/javascript"></script>

<!-- PNotify -->
<script src="${_js}/notify/pnotify.core.js" type="text/javascript"></script>
<script src="${_js}/notify/pnotify.buttons.js" type="text/javascript"></script>
<script src="${_js}/notify/pnotify.nonblock.js" type="text/javascript" ></script>
<script>
    $(document).ready(function () {
        $('input.tableflat').iCheck({
            checkboxClass: 'icheckbox_flat-green',
            radioClass: 'iradio_flat-green'
        });
    });
    
    function initData(action) { 
		var username= $.trim($("#username").val());
    	var deadline = $.trim($("#deadline").find("option:selected").val());
    	var dayline = $.trim($("#dayline").find("option:selected").val());
    	var status = $.trim($("#status").find("option:selected").val());
    	if(username !=""){
    		action += "&username="+username;
    	}
    	if(deadline != -1){
    		action += "&deadline="+deadline;
    	}
    	if(status != -1){
    		action += "&status="+status;
    	}
    	if(dayline!=""&&dayline!="-1"){
    	    action += "&dayline="+dayline;
    	}
		window.location.href=action;
	} 
	$("#query").click(function(){
		initData($("#example").attr('data-action'));
	});
	$("#clear").click(function(){
	  $("#username").val("");
	  $("#deadline").val("-1");
	  $("#status").val("-1")
	});
	$("select").change(function(){
	  var  id=$(this).attr("id");
	  if(typeof(id)!=""&&id=="dayline"){
	    $("#deadline").val("-1")
	  }
	  if(typeof(id)!=""&&id=="deadline"){
	    $("#dayline").val("-1")
	  }
	});
	
</script>
</body>

</html>